package com.swg.seckill.service.impl;

import com.swg.seckill.pojo.Goods;
import com.swg.seckill.mapper.GoodsMapper;
import com.swg.seckill.service.IGoodsService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.swg.seckill.utils.vo.GoodsVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author swg
 * @since 2021-11-23
 */
@Service
public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements IGoodsService {
    @Resource
    private GoodsMapper goodsMapper;

    @Override
    public List<GoodsVo> getGoods() {
        List<GoodsVo> allGoods = goodsMapper.getAllGoods();
        return allGoods;
    }

    @Override
    public GoodsVo listGoods(Long id) {
        return goodsMapper.getGoods(id);
    }
}
